import request from '@/utils/request'

// 查询试卷的题目详情列表
export function getStatics(deptId = null) {
  const params = deptId ? { deptId } : {};

  return request({
    url: '/exam/statics/statistics',
    method: 'get',
    params: params,  // 将参数传递给后台
  });
}
//查询错题记录
export function getErrorRecord(params) {
  return request({
    url: '/exam/question/wrong/list',
    method: 'get',
    params: params,  // 将参数传递给后台
  });
}
export function getUserScores(deptId = null) {
  const params = deptId ? { deptId } : {};

  return request({
    url: '/exam/statics/userScores',
    method: 'get',
    params: params,  // 将参数传递给后台
  });
}
export function getWrongQuestion(params) {
  return request({
    url: '/exam/question/wrong/wrong-question',
    method: 'get'
  });
}
export function getWrongDailyQuestion() {
  return request({
    url: '/exam/question/wrong/wrong-daily-question',
    method: 'get'
  });
}
export function getTaskScore(params) {
  return request({
    url: '/exam/statics/task-score',
    method: 'get',
    params // 自动将参数拼接到 URL 上
  });
}
export function exportTaskScore(query) {
  return request({
    url: '/exam/statics/task-score/export',
    method: 'get',
    params: query,
    responseType: 'blob' // 关键点！
  });
}

